class Solution {
public:
    string arr[10] = { "","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz" };
    void D(string digits, int l, string c, vector<string>& v)
    {
        if (l == digits.size())
        {
            v.push_back(c);
            return;
        }
        int num = digits[l] - '0';
        string s = arr[num];
        for (int i = 0; i < s.size(); i++)
        {
            D(digits, l + 1, c + s[i], v);
        }
    }
    vector<string> letterCombinations(string digits) {
        vector<string> v;
        if (digits.size() == 0)
        {
            return v;
        }
        D(digits, 0, "", v);
        return v;
    }
};